package com.threeti.mecool.core.infrastructure.persistence;

import com.threeti.mecool.core.domain.model.sellinto.SellInto;
import com.threeti.mecool.core.domain.model.sellinto.SellIntoStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface SellIntoRepository extends JpaRepository<SellInto, Long>, JpaSpecificationExecutor<SellInto> {
    /**
     * 取得特定(项目)门店的卖进(表)
     */
    SellInto findByProjectStoreId(Long projectStoreId);

    List<SellInto> findByProjectStore_Channel_Channel_AdCode(String adCode);

    List<SellInto> findByStatusAndProjectStore_Channel_Channel_AdCode(SellIntoStatus status, String adCode);

    List<SellInto> findByStatusAndProjectStore_Channel_Channel_CityAdCode(SellIntoStatus status, String cityAdCode);

    List<SellInto> findByStatusAndProjectStore_Channel_Channel_ProvinceAdCode(SellIntoStatus status, String provinceAdCode);
}
